package com.LA_houseLease.app.controller.leasaterm;


import com.LA_houseLease.app.service.LeaseTermService;
import com.LA_houseLease.common.result.Result;
import com.LA_houseLease.pojo.entity.LeaseTerm;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.index.qual.SameLen;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
@CrossOrigin(origins = "*")
@Slf4j
@RestController
@RequestMapping("/app/term/")
@Tag(name = "租期信息")
public class LeaseTermController {

    @Autowired
    private LeaseTermService leaseTermService;
    @GetMapping("listByRoomId")
    @Operation(summary = "根据房间id获取可选获取租期列表")
    public Result<List<LeaseTerm>> list(@RequestParam Long id) {
        log.warn("根据房间id获取可选获取租期列表--LeaseTermController.list");
        List<LeaseTerm> list=leaseTermService.getLeaseTermList(id);
        return Result.ok(list);
    }
}
